package cn.sxt.clinic.mapper;

import cn.sxt.clinic.pojo.Dictionary;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author ${author}
 * @since 2020-06-29
 */
public interface DictionaryMapper extends BaseMapper<Dictionary> {
    @Select("select d1.*,d2.dictionary_name as parent_name\n" +
            "from t_dictionary d1 LEFT JOIN t_dictionary d2 on d1.parent_id=d2.dictionary_id ${ew.customSqlSegment}")
    IPage<Dictionary> selectOwnConnect(IPage page, @Param(Constants.WRAPPER) Wrapper wrapper);
}
